﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using hospital_registration_system.DAL;
using hospital_registration_system.Entity;

namespace hospital_registration_system.BLL
{
    /// <summary>
    /// 用户信息表服务
    /// </summary>
    public class PatientsService
    {
        protected PatientsDao dao = null;

        public PatientsService()
        {
            dao = new PatientsDao();
        }
        /// <summary>
        /// 通过患者id查询患者信息
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public Patients selectByPatientsId(int id)
        {
            return dao.selectById(id);
        }
        /// <summary>
        /// 更新患者的信息
        /// </summary>
        /// <param name="patients"></param>
        /// <returns></returns>
        public bool update(Patients patients)
        {
            if (patients == null) return false;
            if (patients.Id < 0) return false;
            return dao.update(patients);
        }
    }
}
